package dataBase;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;

import xml.MyDom4j;

public class DbConfig {
	
	private static final String DbConfig_XML="C:\\Users\\Administrator\\workspace\\Graduate\\xml\\DataBaseConfiguration.xml";
	public static String GetDbDriver(String dbType) throws DocumentException, Exception
	{ 
	   Document doc= MyDom4j.Read(DbConfig_XML);
	   Element root=MyDom4j.GetRootElement(doc);
	   Element element=root.element(dbType).element("DRIVER");
	   		return element.getText();
	}

	public static String GetDbUrl(String dbType) throws DocumentException, Exception
	{
		   Document doc= MyDom4j.Read(DbConfig_XML);
		   Element root=MyDom4j.GetRootElement(doc);
		   Element element=root.element(dbType).element("URL");
		   		return element.getText();
	}
	

	public static void main(String[] args) throws DocumentException, Exception
	{
		
	}
}
